<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>登记-安平县居民核酸检测信息系统</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="layui/css/layui.css"  media="all">
  <link rel="stylesheet" href="lay.css"  media="all">
  <script src="https://cdn.bootcdn.net/ajax/libs/fastclick/1.0.6/fastclick.js"></script>
  <script src="jquery.min.js"></script>
  <script src="jquery.cookie.js"></script>
  <script src="fn.js?v=1"></script>
</head>
  <style> 
  .layui-input, .layui-textarea{width: 95%;}
  .layui-form-item .layui-form-label{text-overflow:clip;}
  /* .identity_name{display: none;} */
  .input-code{width: 55%; display: inline;}
  #send_phone{
	padding: 0;
    width: 35%;
    float: right;
    margin-right: 15px;
	font-size: 12px;
  }
  .b{
  	background-color:#cbcbcb;  
  }
  .footer{
  	text-align: center;
  	font-size: 12px;
  	color: #666666;
  	position: fixed;
  	bottom: 0;
  	width: 100%;
  }
  .footer p{
  	margin: 5px 0;
  }
  .layui-elem-quote{
	  text-align: center;
	  border-left:none;
  }
  .showModel{
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.5);
            position: fixed;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
    		z-index: 9999999999;
        }
      .modelBox{
      width: 300px;
      height: 100px;
      background-color: #ffffff;
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      right: 0;
      margin: auto;
      text-align: center;
      line-height: 100px;
      color:red;
      }
      .copy{
            text-align: center;
            width: 100%;
        }
      .layBox{
          min-height: 580px;
          overflow: hidden;
      }
      .h1{
          text-align: center;
          font-size: 22px;
          font-weight: bold;
          margin: 26px 0;
      }
      #main{
          margin: 15px;
          box-shadow: 0 1px 2px #ccc;
          padding: 10px 0 20px 0;
      }
    .button{
        width: 200px;
        position: relative;
        left: 50%;
        margin-left: -100px;
        margin-top: 30px;
    }
  </style>
<body>
  <div id="black"></div>
  <div id="error">
      <div class="errorImg"><img src="error.png" width="180" height="140" /></div>
      <div class="errorTitle">失败，请选择人员入组！</div>
      <div class="errorBtn">
          <span onlick="Close()">点击关闭</span>
      </div>
  </div>
<div class="layBox">
    <div id="main">
        <div class="h1">人员信息</div>
        <div class="layui-form">
            <input type="hidden" name="code" value="" />
            <div class="layui-form-item">
            <label class="layui-form-label">姓名</label>
            <div class="layui-input-block">
                <input type="text" name="name" lay-verify="required" lay-reqtext="请输入真实姓名" autocomplete="off" placeholder="请输入姓名" class="layui-input" disabled id="name">
            </div>
            </div>
            <div class="layui-form-item">
            <label class="layui-form-label">身份证</label>
            <div class="layui-input-block">
                <input type="text" name="idCard" lay-verify="identity" placeholder="请输入身份证号码" autocomplete="off" class="layui-input" disabled id="idCard">
            </div>
            </div>
            
            <!-- <div class="layui-form-item">
            <label class="layui-form-label">手机号</label>
            <div class="layui-input-block">
                <input type="text" name="phone" lay-verify="phone" lay-reqtext="请输入手机号" placeholder="请输入手机号" autocomplete="off" class="layui-input" disabled id="phone">
            </div>
            </div> -->
            
            <div class="button layui-btn" id="sm">确认绑定</div>
        </div>
    </div>
</div>
<div class="copy">
  <p>安平县新冠肺炎疫情防控工作指挥部</p>
  <p>技术支持：智慧安平</p>
</div>
<script src="layui/layui.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
layui.use(['form', 'layer', 'jquery'], function(){
  var form = layui.form
  ,layer = layui.layer
  ,$ = layui.jquery;
});
var code = getUrlName('code');
var userid = $.cookie('userid');
console.log(userid)
$("#name").val($.cookie('name'));
$("#idCard").val($.cookie('idCard'));
$("#phone").val($.cookie('phone'));
if(code == null || code == "" || code == undefined){
    $("body").html("请在微信客户端打开链接")
}else{
  var btn = $("#sm");
  btn.click(function(){
    $.ajax({
        url: "http://user.city1000.cn:9999/hesuan/api/bindUser",
        type: "GET",
        dataType: "json",
        data: {
            'wxcode': code,
            'userid': userid
        },
        success: function (res) {
          //alert(res.code);
          if(res.code != 0){
            layer.msg(res.msg);
            setTimeout(function(){
              $(location).attr('href', "http://user.city1000.cn:9999/weixin/wechat/h5/redirectSomeWhere?url=http://hesuan.city1000.cn/register_v2/search_user.html");
            });
          }else{
            layer.msg(res.msg);
            setTimeout(function(){
              $(location).attr('href', "http://user.city1000.cn:9999/weixin/wechat/h5/redirectSomeWhere?url=http://hesuan.city1000.cn/register_v2/register_index.html");
            });
          }
          console.log(res)
        }
    })
  })
}
</script>

</body>
</html>